package com.nguc.ngucpractice.controller;

import com.nguc.ngucpractice.common.controller.BaseController;
import com.nguc.ngucpractice.service.LoginService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("/portal")
public class LoginController extends BaseController {

    @Resource
    private LoginService loginService;

    @RequestMapping("/login")
    public ModelAndView doLogin(@RequestBody Map<String, Object> map) {
        return feedback(loginService.queryLoginUser((String) map.get("username"), (String) map.get("password")));
    }
}
